package com.kaili.basic.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.kaili.basic.pojo.dto.MdmDeviceSumDTO;
import com.kaili.basic.pojo.dto.MdmDeviceSafetyDto;
import com.kaili.basic.pojo.entity.MdmDeviceEntity;
import com.kaili.basic.pojo.vo.MdmDeviceSignDetailVO;
import com.kaili.basic.pojo.vo.MdmDeviceVO;
import com.kaili.basic.pojo.vo.MdmDeviceSafetyVo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
*  mapper
* @author:zhouyijian
* @Time: 2019-07-24
* @Copyright: ©  杭州凯立通信有限公司 版权所有
* @Warning: 本内容仅限于公司内部传阅,禁止外泄或用于其它商业目的
*/
@Mapper
public interface DeviceMapper extends BaseMapper<MdmDeviceEntity> {

    /**
     * @Desc: 根据imei获取设备状态
     * @author:zhouyijian
     * @time: 2019/7/25 11:09
     * @param imei
     * @return: MdmDeviceEntity
     */
    MdmDeviceVO getIsActionByImei(String imei);

    /**根据条件查询设备信息
     * @Desc:
     * @author:zhouyijian
     * @time: 2019/7/25 11:10
     * @param entity
     * @return: List<MdmDeviceVO>
     */
    List<MdmDeviceVO> queryPageList(MdmDeviceEntity entity);

    /**
     * @Desc:根据ID查询设备登记详情
     * @author:zhouyijian
     * @time: 2019/8/1 18:43
     * @param id
     * @return: com.kaili.basic.pojo.vo.MdmDeviceVO
     */
    MdmDeviceVO getDeviceById(Integer id);

    /**
     * @Desc:查询设备是否存在
     * @author:zhouyijian
     * @time: 2019/7/25 16:20
     * @param map
     * @return: boolean
     */
    MdmDeviceVO validateIsExistByImei(Map<String,Object> map);

    /**
     * @Desc:查询未签到的设备信息
     * @author:zhouyijian
     * @time: 2019/7/26 18:32
     * @param entity
     * @return: MdmDeviceSignDetailVO
     */
    List<MdmDeviceSignDetailVO>  queryUnSignDetail(MdmDeviceEntity entity);


    /**
     * @Desc:查询设备型号
     * @author:zhouyijian
     * @time: 2019/7/30 17:28
     * @return: List<java.lang.String>
     */
    List<MdmDeviceVO> queryModelByTypeId(Integer typeId);

    /**
     * @Desc:查询设备导出信息
     * @author:zhouyijian
     * @time: 2019/8/2 15:59
     * @param entity
     * @return: java.util.List<com.kaili.basic.pojo.vo.MdmDeviceVO>
     */
    List<MdmDeviceVO> queryExportList(MdmDeviceEntity entity);

    /**
     * @Desc:获取设备登记总数
     * @author:zhouyijian
     * @time: 2019/8/1 10:11
     * @return: java.lang.Integer
     */
    Integer getDeviceTotal();

    MdmDeviceEntity getDeviceByImei(String imei);

    /**
     * @Desc:脱离管控设备数
     * @author:zhouyijian
     * @time: 2019/8/1 13:30
     * @return: java.lang.Integer
     */
    Integer getDeviceOutController(MdmDeviceSumDTO dto);

    /**
     * @Desc:告警设备
     * @author:zhouyijian
     * @time: 2019/8/1 15:30
     * @return: java.lang.Integer
     */
    Integer getDeviceWarnTotal();


    MdmDeviceEntity getDeviceBySn(String imei);
    /**
     * @Desc:查询设备型号分布
     * @author:zhouyijian
     * @time: 2019/8/5 10:24
     * @return: java.util.List<com.kaili.basic.pojo.vo.MdmDeviceVO>
     */
    List<MdmDeviceVO> getDeviceModelMap();

    /**
     * @Desc:设备平台
     * @author:zhouyijian
     * @time: 2019/8/5 10:44
     * @return: java.util.List<com.kaili.basic.pojo.vo.MdmDeviceVO>
     */
    List<MdmDeviceVO> getDevicePlatformTotal();


    /**
     * @Desc:启用设备
     * @author:zhouyijian
     * @time: 2019/8/6 9:37
     * @return: int
     */
    int getActionDeviceTotal();

    /**
     * @Desc:条件查询设备信息--设备安全专用
     * @author:shenliqiang
     * @time: 2019/8/8 16:33
     * @return: List
     */
    List<MdmDeviceSafetyVo> queryMdmDeviceSafety(Page<MdmDeviceSafetyVo> page, MdmDeviceSafetyDto safetyDto);
}
